package com.zxy.express.dto;

import com.autopai.base.common.tools.utils.JsonUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * 背诵素材
 *
 * @author zhangxiying ${email}
 * @since ${version} 2025-07-01
 */
@Data
@ApiModel(value = "背诵素材")
public class ReciteMaterialDTO implements Serializable {
    private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "主键ID")
	private Long id;

	@ApiModelProperty(value = "所属分类ID")
	private Long categoryId;

	@ApiModelProperty(value = "所属分类")
	private String category;

	@ApiModelProperty(value = "素材标题")
	private String title;
	@ApiModelProperty(value = "作者")
	private String author;

	@ApiModelProperty(value = "内容")
	private String content;

	@ApiModelProperty(value = "预览内容")
	private String contentPreview;

	@ApiModelProperty(value = "难度 (1:初级, 2:中级, 3:高级)")
	private Integer difficulty;

	private String strDifficulty;

	@ApiModelProperty(value = "练习人次统计")
	private Integer practiceCount;
	@ApiModelProperty(value = "图片url")
	private String imgUrl;
	@ApiModelProperty(value = "标签")
	private String tags;
	@ApiModelProperty(value = "赏析")
	private String appreciation;

	@ApiModelProperty(value = "排序")
	private Integer sort;

//	@ApiModelProperty(value = "是否启用")
//	private Integer isActive;

	@ApiModelProperty(value = "创建时间")
	private Date createDate;

	@ApiModelProperty(value = "")
	private Date updateDate;
	private String[] listTag;

	public String[] getListTag() {
		if (StringUtils.isNotEmpty(tags)) {
			return tags.split( ",");
		}
		return new String[]{};
	}

	public String getStrDifficulty() {
		if (difficulty == null) {
			return "";
		}
		switch (difficulty) {
		case 1:
			return "初级";
		case 2:
			return "中级";
		case 3:
			return "高级";
		default:
			return "";
		}
	}

}